﻿using System;

namespace SlamCms.Common
{
	public static class TimeSpanExtensions
	{
		public static string NoValue = string.Empty;

		public static string ToMinutes(this TimeSpan? timeSpan)
		{
			if (!timeSpan.HasValue)
				return NoValue;

			return Math.Round(timeSpan.Value.TotalMinutes, 2).ToString();
		}
	}
}
